<template>
  <div>
    <h1>组件间通信1：props</h1>
     <h3>count:{{count}}</h3>
    <button @click="updateCount(10)">更新数据</button>
    <hr/>
    <Child2 :count="count" :updateCount="updateCount" />
  </div>
</template>

<script lang="ts" setup name="PropsTest2">
import {defineComponent, ref} from "vue";
import Child2 from './Child2.vue'
  const count = ref(0)
  const updateCount = (num: number) => {
    count.value += num
  }

</script>

<style scoped>

</style>
